package com.v2.k44;


import org.springframework.context.annotation.AnnotationConfigApplicationContext;
import org.springframework.context.support.ClassPathXmlApplicationContext;

/**
 * 测试手动注入
 * 1.1 set注入  <property>方式
 * 1.2 构造注入  <constructor-arg>方式
 */
public class Test {

	public static void main(String[] args) {

		ClassPathXmlApplicationContext applicationContext = new ClassPathXmlApplicationContext("spring-k44.xml");
		Student student  = (Student) applicationContext.getBean("student1");
		Student student2  = applicationContext.getBean(Student.class);

		System.out.println(student);
		System.out.println(student2);

		System.out.println(student.getP1());
		System.out.println(student.getP2());
		System.out.println(student.getName());

	}

}
